import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import './demo.scss'

export default class DemoBox extends Component {

    constructor(props) {
        super(props)
        this.state = {
            title: 'DUI通用业务组件',
            url: [
                {
                  url: '/pages/buyCheck',
                  title: '代购审核'
                },
                {
                  url: '/pages/carriageCheck',
                  title: '运输车辆审核'
                },{
                  url: '/pages/inventoryManage',
                  title: '盘库管理'
                },{
                  url: '/pages/companyCheck',
                  title: '企业入驻审核'
                },
                {
                    url: '/pages/index/index',
                    title: '我的寻车'
                },
                {
                    url: '/pages/usercar/usercar',
                    title: '我的车源'
                },
                {
                    url: '/pages/information/information',
                    title: '信息认证'
                },
                {
                    url: '/pages/usermenber/usermenber',
                    title: '我的员工'
                },
                {
                    url: '/pages/myinfo/myinfo',
                    title: '个人信息'
                },
                {
                    url: '/pages/transportplatform/transportplatform',
                    title: '物流中心'
                },
                {
                    url: '/pages/advancefund/advancefund',
                    title: '车辆代购'
                },
                {
                    url: '/pages/mylogistics/mylogistics',
                    title: '我的物流'
                },
                {
                    url: '/pages/mytracks/mytracks',
                    title: '我的足迹'
                },
                {
                    url: '/pages/mycollections/mycollections',
                    title: '我的收藏'
                },
                {
                    url: '/pages/setup/setup',
                    title: '设置'
                },
                {
                    url: '/pages/carinformation/carinformation',
                    title: '互通消息'
                },
				{
				    url: 'pages/mortgage/vehicleStatistics', //申请按揭
				    title: '车型排名'
				},
				{
				    url: '/pages/mortgage/statistics', //按揭统计
				    title: '按揭统计'
				},
				{
				    url: '/pages/mortgage/dinventoryStatics', //盘库统计
				    title: '盘库统计'
				},
                {
                    url: '/pages/mortgage/advanceStatics', //垫资统计
                    title: '垫资统计'
                },
                {
                    url: '/pages/historyOrder/info', //数据统计
                    title: '数据统计'
                }
            ]
        }
    }

    onUrl(url) {
        Taro.navigateTo({
            url
        })
    }

    render() {
        const {
            url
        } = this.state
        return (
            <View className="b_demo">
                {
                    url && url.map(item => {
                        return <View className='b_demo--list' onClick={this.onUrl.bind(this, item.url)}>{item.title}</View>
                    })
                }
            </View>
        )
    }
}
